<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

return new class extends Migration {
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('materials', function (Blueprint $table) {
            $table->id();
            $table->unsignedBigInteger('project_id')->default(0)->comment('项目');
            $table->string('name')->default('')->comment('文件名');
            $table->string('path')->default('')->comment('文件路径');
            $table->string('size')->default('')->comment('文件大小(b)');
            $table->string('ext')->default('')->comment('文件类型');
            $table->boolean('buy')->default(false)->comment('购买状态');
            $table->softDeletes();
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('materials');
    }
};
